package com.example.produces.service.impl;

import com.example.produces.entity.Spolied;
import com.example.produces.mapper.SpoliedMapper;
import com.example.produces.service.SpoliedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SpoliedImpl implements SpoliedService {
    @Autowired
    private SpoliedMapper spoliedMapper;
    @Override
    public List<Spolied> findAll() {
        List<Spolied>spolieds=spoliedMapper.findAll();
        return spolieds;
    }

    @Override
    public void add(Spolied spolied) {
     spoliedMapper.add(spolied);
    }

    @Override
    public Spolied findOne(String name) {

        return spoliedMapper.findOne(name);
    }

    @Override
    public void upDate(Spolied spolied) {
     spoliedMapper.upDate(spolied);
    }

    @Override
    public void delete(String name) {
      spoliedMapper.delete(name);
    }
}
